// 这个是管理路由引入和配置的文件
// 引入组件
import Admin from './pages/Admin.vue'
import Index from './pages/Index.vue'
import Login from './pages/Login.vue'
// 引入商户管理的组件
import Merchant from './pages/merchant/Merchant.vue'
import Adduser from './pages/merchant/AddUser.vue'
import MyMerchant from './pages/merchant/MyMerchant.vue'
import AddedServices from './pages/merchant/AddedServices.vue'
import Secondary from './pages/merchant/Secondary.vue'
import MerchantDetails from './pages/merchant/MerchantDetails.vue'
import VersionUp1 from './pages/merchant/VersionUP1.vue'
import VersionUpdata from './pages/merchant/VersionUpdata.vue'
import Source from './pages/merchant/Source.vue'
import OverdueMerchants from './pages/merchant/OverdueMerchants.vue'
// 商户调整
import MerchantsToAdjust from './pages/MerchantsToAdjust.vue'
// 引入订单管理的组件
import Order from './pages/order/Order.vue'
import MsgOrder from './pages/order/MsgOrder.vue'
import VersionsOrder from './pages/order/VersionsOrder.vue'
import HardwareOrder from './pages/order/HardwareOrder.vue'
import AppreciationOrder from './pages/order/AppreciationOrder.vue'
import MsgChanges from './pages/order/MsgChanges.vue'
// 引入待办事项的组件
import Schedule from './pages/schedule/Schedule.vue'
import AppApplication from './pages/schedule/AppApplication.vue'
import CreationApplet from './pages/schedule/CreationApplet.vue'
import PayApplication from './pages/schedule/PayApplication.vue'
import SubmitPayment from './pages/schedule/SubmitPayment.vue'
import PayInformation from './pages/schedule/PayInformation.vue'
// 引入明细中心的组件
import Detail from './pages/detail/Detail.vue'
import BillingDetails from './pages/detail/BillingDetails.vue'
import PersonalDetails from './pages/detail/PersonalDetails.vue'
import MerchantMsgChanges from './pages/detail/MerchantMsgChanges.vue'
// 引入账户管理的组件
import Account from './pages/account/Account.vue'
import PersonalData from './pages/account/PersonalData.vue'
import ChangePassword from './pages/account/ChangePassword.vue'
import MsgRecharge from './pages/account/MsgRecharge.vue'
import SettingPayFor from './pages/account/SettingPayFor.vue'
import Customization from './pages/account/Customization.vue'
import RoleControl from './pages/account/RoleControl.vue'
import UserControl from './pages/account/UserControl.vue'
import OperationLog from './pages/account/OperationLog.vue'
// 引入帮助中心的组件
import Help from './pages/help/Help.vue'
import Feedback from './pages/help/Feedback.vue'
import Downloads from './pages/help/Downloads.vue'
import Problem from './pages/help/Problem.vue'
// 引入需求管理
import Demand from './pages/Demand.vue'
import DemandForm from './pages/DemandForm.vue'
// 路由配置
const routes = [{
    path: "/",
    redirect: "/login"
  },
  {
    path: "/login",
    component: Login,
    meta: {
      title: "登录",
    }
  },
  {
    path: "/admin",
    component: Admin,
    redirect: "/admin/index",
    meta: "代理商平台",
    children: [{
        path: "index",
        component: Index,
        meta: {
          title: "首页"
        }
      },
      // 商户管理
      {
        path: "/admin/merchant",
        redirect: "/admin/merchant/myMerchant",
        component: Merchant,
        meta: {
          title: "商户管理",
        },
        children: [{
            path: "addUser",
            component: Adduser,
            meta: {
              title: "新增商户",
            },
          }, {
            path: "myMerchant",
            component: MyMerchant,
            meta: {
              title: "我的商户",
              keepAlive: true // 需要缓存
            },
          }, {
            path: "addedServices",
            component: AddedServices,
            meta: {
              title: "增值服务",
            },
          }, {
            path: "secondary",
            component: Secondary,
            meta: {
              title: "二级代理商户",
            },
          }, {
            path: "merchantDetails",
            component: MerchantDetails,
            meta: {
              title: "商户详情",
            },
          },
          {
            path: "versionUp1",
            component: VersionUp1,
            meta: {
              title: "版本升级",
            },
          }, {
            path: "versionUpdata",
            component: VersionUpdata,
            meta: {
              title: "版本升级",
            },
          }, {
            path: "source",
            component: Source,
            meta: {
              title: "商户来源",
            },
          }, {
            path: "overdueMerchants",
            component: OverdueMerchants,
            meta: {
              title: "过期商户",
            },
          },
        ]
      },
      // 商户调整
      {
        path: "/admin/merchantsToAdjust",
        component: MerchantsToAdjust,
        meta: {
          title: "商户调整",
        }
      },
      // 订单管理
      {
        path: "/admin/order",
        redirect: "/admin/order/versionsOrder",
        component: Order,
        meta: {
          title: "订单管理",
        },
        children: [{
            path: "msgOrder",
            component: MsgOrder,
            meta: {
              title: "短信订单",
            },
          },
          {
            path: "versionsOrder",
            component: VersionsOrder,
            meta: {
              title: "软件订单",
            },
          },
          {
            path: "hardwareOrder",
            component: HardwareOrder,
            meta: {
              title: "硬件订单",
            },
          },
          {
            path: "appreciationOrder",
            component: AppreciationOrder,
            meta: {
              title: "增值订单",
            },
          },
          {
            path: "msgChanges",
            component: MsgChanges,
            meta: {
              title: "短信变动订单",
            },
          },
        ]
      },
      // 待办事项
      {
        path: "/admin/schedule",
        redirect: "/admin/schedule/appApplication",
        component: Schedule,
        meta: {
          title: "待办事项",
        },
        children: [{
            path: "appApplication",
            component: AppApplication,
            meta: {
              title: "小程序申请记录",
            },
          },
          {
            path: "creationApplet",
            component: CreationApplet,
            meta: {
              title: "创建小程序",
            },
          },
          {
            path: "payApplication",
            component: PayApplication,
            meta: {
              title: "支付申请记录",
            },
          },
          {
            path: "submitPayment",
            component: SubmitPayment,
            meta: {
              title: "新增支付资料",
            },
          },
          {
            path: "payInformation",
            component: PayInformation,
            meta: {
              title: "支付申请资料",
            },
          }
        ]
      },
      // 明细中心
      {
        path: "/admin/detail",
        redirect: "/admin/detail/billingDetails",
        component: Detail,
        meta: {
          title: "结算中心",
        },
        children: [{
          path: "billingDetails",
          component: BillingDetails,
          meta: {
            title: "结算明细",
          },
        }, {
          path: "personalDetails",
          component: PersonalDetails,
          meta: {
            title: "余额变动",
          },
        }, {
          path: "merchantMsgChanges",
          component: MerchantMsgChanges,
          meta: {
            title: "短信变动",
          },
        }, ]
      },
      // 账户管理
      {
        path: "/admin/account",
        redirect: "/admin/account/personalData",
        component: Account,
        meta: {
          title: "账户信息",
        },
        children: [{
          path: "personalData",
          component: PersonalData,
          meta: {
            title: "个人资料",
          },
        }, {
          path: "changePassword",
          component: ChangePassword,
          meta: {
            title: "密码修改",
          },
        }, {
          path: "msgRecharge",
          component: MsgRecharge,
          meta: {
            title: "短信充值",
          },
        }, {
          path: "settingPayFor",
          component: SettingPayFor,
          meta: {
            title: "支付配置",
          },
        }, {
          path: "customization",
          component: Customization,
          meta: {
            title: "主页自定义",
          },
        }, {
          path: "roleControl",
          component: RoleControl,
          meta: {
            title: "角色管理",
          },
        }, {
          path: "userControl",
          component: UserControl,
          meta: {
            title: "用户管理",
          },
        }, {
          path: "operationLog",
          component: OperationLog,
          meta: {
            title: "操作日志",
          },
        }]
      },
      // 帮助中心
      {
        path: "/admin/help",
        redirect: "/admin/help/problem",
        component: Help,
        meta: {
          title: "帮助中心",
        },
        children: [{
          path: "feedback",
          component: Feedback,
          meta: {
            title: "反馈问题",
          },
        }, {
          path: "downloads",
          component: Downloads,
          meta: {
            title: "软件下载",
          },
        }, {
          path: "problem",
          component: Problem,
          meta: {
            title: "常见问题",
          },
        }]
      },
      // 需求管理
      {
        path: "/admin/demand",
        component: Demand,
        meta: {
          title: "需求管理",
        },
      },
      {
        path: "/admin/demandForm",
        component: DemandForm,
        meta: {
          title: "需求表单",
        },
      },
    ]
  }
]
export default routes
// OperationLog
